<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : leagueSelect.xsl
    Created on : Utorok, 2010, apríl 20, 12:23
    Author     : Football-Statistics Team
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" omit-xml-declaration="yes" media-type="html/text"/>
    <xsl:param name="lid"/>
    <xsl:param name="redirect"/>
    <xsl:param name="select_season"/>
    <xsl:template match="/leagues">
        <select onchange="redirect('{$redirect}'+this.value, 'loader_league', 'Loading...')">
        <option value=""><xsl:value-of select="$select_season"/></option>
        <xsl:for-each select="league">
            <optgroup label="{name}" >
            <xsl:for-each select="season">
                <xsl:choose>
                    <xsl:when test="@id=$lid">
                        <option value="{@id}" selected="selected"><xsl:value-of select="./parent::*/name"/> (<xsl:value-of select="."/>)</option>
                    </xsl:when>
                    <xsl:otherwise>
                        <option value="{@id}"><xsl:value-of select="./parent::*/name"/> (<xsl:value-of select="."/>)</option>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
            </optgroup>
        </xsl:for-each>
        </select>
        <span id="loader_league">asdfasdf</span>
    </xsl:template>
</xsl:stylesheet>
